#{extends 'Users/frame.html' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/message.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/navigationbar.scss'}" />
#{/set}
#{set 'moreScripts'}
#{/set}
<script language="javascript">
//左边列表选中状态。
$(function(){
	$("#mi_message").addClass("menu-select");
});
</script>
<div class="navigationBar">
	<table>
		<tr>
			<td><img src="@{'/public/images/navigationHouse.gif'}"></td>
			<td><strong>当前位置：</strong></td>
			<td>
				<a href="/">首页</a>
				>>
				<a href="/users">会员中心</a>
				>>
				<font class="current">发送消息或退款</font>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
$(function(){
	countNumber();
	$("#msgContent").keyup(countNumber);
	$("#msgContent").change(countNumber);
});
function countNumber() {
	var content = $("#msgContent").val();
	var leftCount = 200;
	var overCount = 0;
	if(content) {
		leftCount = 200 - content.length;
		if(leftCount < 0) {
			leftCount = 0;
			overCount = content.length - 200;
		}
	}
	$("#strLeft").html(leftCount);
	$("#strOver").html(overCount);
}
function sendMessage() {
	$("#form1").submit();
}
function reset() {
	window.location.href="/users/message/new";
}
</script>
</table>
<div class="edit-message">
	<div id="errMsg" class="error">
		${errMsg}
		#{error 'errMsg'/}
	</div>
	#{form @UserMessage.sendMessage(), name:'form1', id:'form1'}
	<p>
		<label><input type="radio" name="msg.type" value="CONSULTING" #{if msg.type == models.Message.MessageType.CONSULTING}CHECKED#{/if} >咨询</label>&nbsp;&nbsp;
		<label><input type="radio" name="msg.type" value="SUGGEST" #{if msg.type == models.Message.MessageType.SUGGEST}CHECKED#{/if} >建议</label>&nbsp;&nbsp;
		<label><input type="radio" name="msg.type" value="REFUND" #{if msg.type == models.Message.MessageType.REFUND}CHECKED#{/if} >退款</label>&nbsp;&nbsp;
		<label><input type="radio" name="msg.type" value="OTHER" #{if msg.type == models.Message.MessageType.OTHER}CHECKED#{/if} >其他</label>&nbsp;&nbsp;
	</p>
	<br>
	<p>
		<textarea id="msgContent" name="msg.content" style="width:300px;height:110px;">${msg.content}</textarea>
		<span class="error">#{error 'msg.content' /}</span>
	</p>
	<br>
	<p>
		总共可填写<font class="important_1_1">&nbsp;200&nbsp;</font>个字;你还可以填写
		&nbsp;<font class="important_2" id="strLeft"></font>&nbsp;个字;
		超出&nbsp;<font class="important_1" id="strOver"></font>&nbsp;个字。
	</p>
	#{/form}
	<p>
		<input type="button" class="button1" value="发送" onClick="sendMessage()">
		<input type="button" class="button1" value="重置" onClick="reset()">
	</p>
</div>